package com.example.firstsb;

import com.example.firstsb.entity.Student;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@SpringBootApplication
@RestController
@Slf4j
public class FirstsbApplication {

    public static void main(String[] args) {
        SpringApplication.run(FirstsbApplication.class, args);
    }

   // private static final Logger logger = LoggerFactory.getLogger(FirstsbApplication.class);

    @GetMapping("/hello")
    public Object hello(){
        log.info("get...hello");
        HashMap<String,Object> map = new HashMap<>();
        map.put("code",205);
        map.put("username","jack23");
        Student student = Student.builder().id(156).name("rose").build();
        log.info(student.toString());
        map.put("student",student);
        return map;
    }
}
